/*
 * @Author: 2112778581 2112778581@qq.com
 * @Date: 2023-10-20 09:16:44
 * @LastEditors: fengshan@0525 3183359488@qq.com
 * @LastEditTime: 2023-12-12 16:12:37
 * @FilePath: \cra-front\src\views\Home\Swipers\useHooksTable.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { ref, reactive } from 'vue'

export default function () {
  const tableColumns = [
    {
      label: '图片',
      prop: 'url',
      slotable: true
    },
    {
      label: '名称',
      prop: 'name',
      showOverflowTooltip: true
    },
    {
      label: '描述',
      prop: 'desc',
      showOverflowTooltip: true
    },
    {
      label: '跳转类型',
      prop: 'linkType',
      slotable: true
    },
    {
      label: '跳转链接',
      prop: 'toLinkDetail',
      showOverflowTooltip: true
    },
    {
      label: '是否展示',
      prop: 'isShow',
      slotable: true
    },
    {
      label: '排序',
      prop: 'order'
    },
    {
      label: '创建时间',
      prop: 'createdAt',
      time: true
    }
  ]
  const tableData = ref()
  const tableOptions = {
    showOption: true
  }
  const linkTypeList = [
    { label: '跳转页面', value: '1' },
    { label: '跳转新闻', value: '2' },
    { label: '跳转产品', value: '3' }
  ]
  const pagesList = [
    { label: '动态', value: '/news' },
    { label: '产品', value: '/product' },
    { label: '服务', value: '/service' },
    { label: '联系', value: '/contact' },
    { label: '搜索', value: '/search' }
  ]
  const prodList = ref([])
  const newsList = ref([])
  return {
    tableColumns, tableData, tableOptions, linkTypeList, pagesList, prodList, newsList
  }
}
